home *** CD-ROM | disk | FTP | other *** search
/ Champak 43 / Vol 43.iso / games / penguin.swf / scripts / DefineSprite_602 / frame_1 / DoAction.as
Encoding:
Text File  |  2007-06-26  |  1.0 KB  |  57 lines

  1. function getReady()
  2. {
  3.    _root.bulletNow_ready.play();
  4.    gotoAndStop("shootReady");
  5.    play();
  6. }
  7. function shootStart()
  8. {
  9.    _root.controlNow.activeStart();
  10. }
  11. function onShootEnd()
  12. {
  13.    gotoAndStop("shootEnd");
  14.    play();
  15. }
  16. function onShootEnd_2()
  17. {
  18.    bulletNum--;
  19.    _root.setBulletNum(bulletNum);
  20.    if(_root.mc.balloonNum == 0)
  21.    {
  22.       showWin();
  23.       return undefined;
  24.    }
  25.    if(bulletNum == 0)
  26.    {
  27.       showEnd();
  28.       return undefined;
  29.    }
  30.    _root.mc.resetBullet(_root.playerSide);
  31.    nextShoot(_root.playerSide);
  32.    getReady();
  33. }
  34. function nextShoot(id)
  35. {
  36.    _root.roleNow = _root.role;
  37.    _root.controlNow = _root.control;
  38.    _root.bulletNow = _root.bullet;
  39.    _root.bulletNow_ready = _root.bullet_ready;
  40.    _root.mc.cameraMoveTo(_root.role,_root.centerX,_root.centerY + 80);
  41. }
  42. function showEnd()
  43. {
  44.    _root.hideStatus();
  45.    gotoAndStop("end");
  46.    play();
  47. }
  48. function showWin()
  49. {
  50.    _root.hideStatus();
  51.    gotoAndStop("win");
  52.    play();
  53. }
  54. stop();
  55. var bulletNum = 5;
  56. _root.setBulletNum(bulletNum);
  57.